package com.xiashitech.interfaces.grpc;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 * <pre>
 * 服务接口.定义请求参数和相应结果
 * </pre>
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.58.0)",
    comments = "Source: agent.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class RPCIncrementalCacheServiceGrpc {

  private RPCIncrementalCacheServiceGrpc() {}

  public static final java.lang.String SERVICE_NAME = "com.xiashitech.interfaces.grpc.RPCIncrementalCacheService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest,
      com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse> getBiStreamIncrementalCacheMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "biStreamIncrementalCache",
      requestType = com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest.class,
      responseType = com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest,
      com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse> getBiStreamIncrementalCacheMethod() {
    io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest, com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse> getBiStreamIncrementalCacheMethod;
    if ((getBiStreamIncrementalCacheMethod = RPCIncrementalCacheServiceGrpc.getBiStreamIncrementalCacheMethod) == null) {
      synchronized (RPCIncrementalCacheServiceGrpc.class) {
        if ((getBiStreamIncrementalCacheMethod = RPCIncrementalCacheServiceGrpc.getBiStreamIncrementalCacheMethod) == null) {
          RPCIncrementalCacheServiceGrpc.getBiStreamIncrementalCacheMethod = getBiStreamIncrementalCacheMethod =
              io.grpc.MethodDescriptor.<com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest, com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "biStreamIncrementalCache"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse.getDefaultInstance()))
              .setSchemaDescriptor(new RPCIncrementalCacheServiceMethodDescriptorSupplier("biStreamIncrementalCache"))
              .build();
        }
      }
    }
    return getBiStreamIncrementalCacheMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static RPCIncrementalCacheServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCIncrementalCacheServiceStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCIncrementalCacheServiceStub>() {
        @java.lang.Override
        public RPCIncrementalCacheServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCIncrementalCacheServiceStub(channel, callOptions);
        }
      };
    return RPCIncrementalCacheServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static RPCIncrementalCacheServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCIncrementalCacheServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCIncrementalCacheServiceBlockingStub>() {
        @java.lang.Override
        public RPCIncrementalCacheServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCIncrementalCacheServiceBlockingStub(channel, callOptions);
        }
      };
    return RPCIncrementalCacheServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static RPCIncrementalCacheServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCIncrementalCacheServiceFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCIncrementalCacheServiceFutureStub>() {
        @java.lang.Override
        public RPCIncrementalCacheServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCIncrementalCacheServiceFutureStub(channel, callOptions);
        }
      };
    return RPCIncrementalCacheServiceFutureStub.newStub(factory, channel);
  }

  /**
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public interface AsyncService {

    /**
     * <pre>
     * agent 缓存用户信息，需要服务端推送，目前好像没用
     * </pre>
     */
    default io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest> biStreamIncrementalCache(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getBiStreamIncrementalCacheMethod(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service RPCIncrementalCacheService.
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public static abstract class RPCIncrementalCacheServiceImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return RPCIncrementalCacheServiceGrpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service RPCIncrementalCacheService.
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public static final class RPCIncrementalCacheServiceStub
      extends io.grpc.stub.AbstractAsyncStub<RPCIncrementalCacheServiceStub> {
    private RPCIncrementalCacheServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCIncrementalCacheServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCIncrementalCacheServiceStub(channel, callOptions);
    }

    /**
     * <pre>
     * agent 缓存用户信息，需要服务端推送，目前好像没用
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest> biStreamIncrementalCache(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
          getChannel().newCall(getBiStreamIncrementalCacheMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service RPCIncrementalCacheService.
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public static final class RPCIncrementalCacheServiceBlockingStub
      extends io.grpc.stub.AbstractBlockingStub<RPCIncrementalCacheServiceBlockingStub> {
    private RPCIncrementalCacheServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCIncrementalCacheServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCIncrementalCacheServiceBlockingStub(channel, callOptions);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service RPCIncrementalCacheService.
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public static final class RPCIncrementalCacheServiceFutureStub
      extends io.grpc.stub.AbstractFutureStub<RPCIncrementalCacheServiceFutureStub> {
    private RPCIncrementalCacheServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCIncrementalCacheServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCIncrementalCacheServiceFutureStub(channel, callOptions);
    }
  }

  private static final int METHODID_BI_STREAM_INCREMENTAL_CACHE = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AsyncService serviceImpl;
    private final int methodId;

    MethodHandlers(AsyncService serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_BI_STREAM_INCREMENTAL_CACHE:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.biStreamIncrementalCache(
              (io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse>) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getBiStreamIncrementalCacheMethod(),
          io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
            new MethodHandlers<
              com.xiashitech.interfaces.grpc.RPCIncrementalCacheRequest,
              com.xiashitech.interfaces.grpc.RPCIncrementalCacheResponse>(
                service, METHODID_BI_STREAM_INCREMENTAL_CACHE)))
        .build();
  }

  private static abstract class RPCIncrementalCacheServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    RPCIncrementalCacheServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.xiashitech.interfaces.grpc.RPCAgentServiceApi.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("RPCIncrementalCacheService");
    }
  }

  private static final class RPCIncrementalCacheServiceFileDescriptorSupplier
      extends RPCIncrementalCacheServiceBaseDescriptorSupplier {
    RPCIncrementalCacheServiceFileDescriptorSupplier() {}
  }

  private static final class RPCIncrementalCacheServiceMethodDescriptorSupplier
      extends RPCIncrementalCacheServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final java.lang.String methodName;

    RPCIncrementalCacheServiceMethodDescriptorSupplier(java.lang.String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (RPCIncrementalCacheServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new RPCIncrementalCacheServiceFileDescriptorSupplier())
              .addMethod(getBiStreamIncrementalCacheMethod())
              .build();
        }
      }
    }
    return result;
  }
}
